$(window).ready(function(){

      var kg1=true;

    var aud=document.querySelector(".aud");

    var gq1=document.querySelector(".gq1")


    gq1.addEventListener("touchend",function(){

        if(kg1==true){

            $(".gq2").animate({
                "top":"30px"
            },700);

            $(".gq3").animate({
                "top":"75px"
            },700);


            kg1=false;


        }else{


            $(".gq2").animate({
                "top":"-15px"
            },700);

            $(".gq3").animate({
                "top":"-15px"
            },700);

            kg1=true;

        }
    });



  $(".st-c-t").click(function(){

      $(".st-c-t").css({

          "display":"none"
      });
      $(".st-c-b").css({

          "display":"none"

      });

      $(".st-c-yc").css({

          "display":"block"
      });

          sj();

          aud.play();



      $(".st-c-yc-dy-l").attr("class","st-c-yc-dy-l dh");

      $(".st-c-yc-dy-r").attr("class","st-c-yc-dy-r dhr");


  });




    $(".st-c-yc-dy-x").click(function(){
            $(".st-c-yc").css({
                "display":"none"
            });
          $(".st-c-t").css({
            "display":"block"
        });
        $(".st-c-b").css({
            "display":"block"
        });
            $(".st-c-yc-dy-l").attr("class","st-c-yc-dy-l");
            $(".st-c-yc-dy-r").attr("class","st-c-yc-dy-r");
            aud.pause();
    });
      function sj(){
          var se= setInterval(function(){
              var m=Math.floor(aud.duration )-Math.floor(aud.currentTime );
              //console.log(m);
              if(m==0){
                  $(".sp2").text(0);
                  $(".sp4").text(0);
                  $(".sp3").text(0);
                  $(".st-c-yc-dy-l").attr("class","st-c-yc-dy-l");
                  $(".st-c-yc-dy-r").attr("class","st-c-yc-dy-r");
                  $(".st-c-yc").css({
                      "display":"none"
                  });
                  $(".st-c-t").css({
                      "display":"block"
                  });
                  $(".st-c-b").css({
                      "display":"block"
                  });
                  return;
              }
               $(".sp1").text(Math.floor(m/3600));
               $(".sp2").text(Math.floor(m/60));
               $(".sp3").text(Math.floor(m%60/10));
               var f=m%60;
               $(".sp4").text(f- Math.floor(f/10)*10);
           },1000)
      }
    $(".head-l").click(function(){
        window.history.go(-1);
    });

    var tex=$(".tex");
    console.log(tex[1]);
    $.ajax({
      type:"post",
      url:"./json/mov.json ",
      //url:"http://ttq.zhizaizi.com/webui/json/mov.json ",
      dataType: "json",
      data:"",
      success:function(data){
          $(".xhd").each(function(i){
              $(this).click(function(){
                  //换图
                  var gqtimg=$(".gqtimg").attr("src");
                  var img=$(this).children()[1];
                  var hgiimg=img.src;
                  $(".gqtimg").attr("src",hgiimg);
                  var tex=$(this).children()[0];
                  var texx=data.wz[i+1];
                  console.log(texx);
                  $(".txt-b").text(texx);
                  var bt=$(this).children()[2];
                  var bttext=bt.innerHTML;
                  $(".txt-t").text(bttext);
              })
          });

    },

     error:function(){
         //alert("服务器开了点小差哦！");
        }
    });
    //console.log($(".texdiv").text());
    //var tex=$(".tex");
    //console.log(arr);
    //
    //console.log(arr[0][wz]);
    //
    //for(var h=0;h<=arr.length;h++){
    //
    //       //tex[h].innerText=arr[h].wz;
    //
    //}
});
